package org.zb.api.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AdminController {

	@GetMapping("/api/user")
	public User user(User model){
		
		User user= new User();
		user.setUsername("hello");
		user.setNickname("world");
		if(model!=null){
			user.setNickname(model.getNickname());
		}
		return user;
	}
	
	@GetMapping("/api/user/{id}")
	public User user(@PathVariable(name="id") Long id){
		User user= new User();
		user.setUsername("hello1");
		user.setNickname("world1");
		return user;
	}
}
